<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
	<head>
            <meta charset="utf-8">
            <title><?php echo ($seo_title); ?></title>
            <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
            <meta name="apple-mobile-web-app-capable" content="yes">
            <meta name="apple-mobile-web-app-status-bar-style" content="black">
            <meta name="format-detection" content="telephone=no" />
            <meta name="format-detection" content="email=no" />
            <meta name="keywords" content="<?php echo ($seo_keywords); ?>" />
            <meta name="description" content="<?php echo ($seo_description); ?>">
            <meta name="screen-orientation" content="portrait">
            <meta name="x5-orientation" content="portrait">
            <link rel="shortcut icon" href=" /favicon.ico" />
            <link rel="apple-touch-icon" href="/icon.png" />
            <link rel="apple-touch-start-image" href="/start.png" />

            <link rel="stylesheet" type="text/css" href="/Static/mobile/css/style.css">
            <link rel="stylesheet" type="text/css" href="/Static/mobile/css/SpsBtn.css">
            <script src="/Static/mobile/js/jquery.js"></script>
            <script src="/Static/mobile/js/layer.mobile-v1.6/layer.m.js"></script>
            <script src="/Static/mobile/js/common.js"></script>
            <script src="/Static/mobile/js/jquery.lazyload.min.js"></script>
            <link rel="stylesheet" type="text/css" href="/Static/mobile/iconfont/iconfont.css">
            <!-- 微信分享 -->
            <!-- 如果是微信客户端 -->
<input id="networkType" value="" type="hidden">
<?php if($is_wechat){ ?>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js" type="text/javascript"></script>
<script type="text/javascript">
		wx.config({
		
		<?php if($hlopenid =="oaGjOtyJCTObWB2BZbkLfxyVHTMA"){?>
		 debug:true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，
		
		<?php } ?>
		
		  //若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
		  appId:'<?php echo ($jssign['appid']); ?>', // 必填，公众号的唯一标识
		  timestamp:'<?php echo ($jssign['timestamp']); ?>', // 必填，生成签名的时间戳
		  nonceStr:'<?php echo ($jssign['noncestr']); ?>', // 必填，生成签名的随机串
		  signature:'<?php echo ($jssign['signature']); ?>',// 必填，签名，见附录1
	      jsApiList: [
	                  'checkJsApi',
	                  'onMenuShareTimeline',
	                  'onMenuShareAppMessage',
	                  'onMenuShareQQ',
	                  'onMenuShareWeibo',
	                  'onMenuShareQZone',
	                  'hideMenuItems',
	                  'showMenuItems',
	                  'hideAllNonBaseMenuItem',
	                  'showAllNonBaseMenuItem',
	                  'translateVoice',
	                  'startRecord',
	                  'stopRecord',
	                  'onVoiceRecordEnd',
	                  'playVoice',
	                  'onVoicePlayEnd',
	                  'pauseVoice',
	                  'stopVoice',
	                  'uploadVoice',
	                  'downloadVoice',
	                  'chooseImage',
	                  'previewImage',
	                  'uploadImage',
	                  'downloadImage',
	                  'getNetworkType',
	                  'openLocation',
	                  'getLocation',
	                  'hideOptionMenu',
	                  'showOptionMenu',
	                  'closeWindow',
	                  'scanQRCode',
	                  'chooseWXPay',
	                  'openProductSpecificView',
	                  'addCard',
	                  'chooseCard',
	                  'openCard'
	                ] // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
		});
		
		wx.ready(function(){
			//分享到朋友圈
		  wx.onMenuShareTimeline({
		    title:'<?php echo $share_title ? $share_title : C("SHARE_DEFAULT_TITLE");?>', // 分享标题
		    link:'<?php echo $share_url ? $share_url : C("SHARE_DEFAULT_URL");?>', // 分享链接
		    imgUrl:'<?php echo $share_img ? $share_img : C("SHARE_DEFAULT_IMG");?>', // 分享图标
		    success: function(){
		    	
		    },
		    cancel: function(){
		    }
		  });
		  //分享给好友
		  wx.onMenuShareAppMessage({
		    title:'<?php echo $share_title ? $share_title : C("SHARE_DEFAULT_TITLE");?>', // 分享标题
		    desc:'<?php echo $share_description ? $share_description : C("SHARE_DEFAULT_DESC");?>', // 分享描述
		    link:'<?php echo $share_url ? $share_url : C("SHARE_DEFAULT_URL");?>', // 分享链接
		    imgUrl:'<?php echo $share_img ? $share_img : C("SHARE_DEFAULT_IMG");?>', // 分享图标
		    type: '',
		    dataUrl: '',
		    success: function () { 
		    },
		    cancel: function () { 
		
		    }
		  });  
		  
		  wx.getNetworkType({
			    success: function (res) {
			        var networkType = res.networkType; // 返回网络类型2g，3g，4g，wifi
			        $("#networkType").val(networkType);
			    }
			});
		  
		  //复制链接menuItem:copyUrl
		  wx.hideMenuItems({
			 menuList: ["menuItem:originPage",
			            "menuItem:share:facebook",
			            "menuItem:share:qq",
			            "menuItem:share:weiboApp",
			            "menuItem:share:QZone",
			            "menuItem:readMode",
			         //   "menuItem:openWithQQBrowser",
			         //   "menuItem:openWithSafari",
			            "menuItem:share:email",
			            "menuItem:share:brand",
			            "menuItem:copyUrl",//复制链接
			            <?php if($controller == 'qrcode'){ ?>
			            "menuItem:share:timeline",//朋友圈
			            "menuItem:share:appMessage",//朋友
			            <?php } ?>
			            ], // 要隐藏的菜单项，只能隐藏“传播类”和“保护类”按钮，所有menu项见附录3
		      success: function (res) {
		         // alert('已隐藏“阅读模式”，“分享到朋友圈”，“复制链接”等按钮');
		        },
		        fail: function (res) {
		          //alert(JSON.stringify(res));
		        }
		  });
		  
		  //wx.hideOptionMenu();//批量隐藏保护类 传播类按钮
		 
		});

		//浏览图片
		function previewImage(now_pic,pics){
			wx.previewImage({
			   current: now_pic, // 当前显示图片的http链接
			   urls: pics // 需要预览的图片http链接列表
			});
		}
		
		//浏览图片
		$('.previewImageList').on('click', function(){
			var now_pic = $(this).attr("src");
			var pics = new Array();
			
			$('.previewImage').each(function(index) {
				pics[index] = $(this).attr("src");
			 });
			
			previewImage(now_pic,pics);
			
		});

		</script>

<?php } ?>
		
<?php if(!$is_mobile){ ?>
        <style>
html,body{
    height:100%;
    width:50%;
    margin:0 auto;
}
.nav{
    position:fixed;
    width:25%;

}
.morder_nav{
	position:absolute;
}
</style>
<?php } ?>
	</head>
<body>
	<link rel="stylesheet" href="/Static/mobile/css/cart.css">
<link rel="stylesheet" href="/Static/mobile/css/buy.css">
<link rel="stylesheet" href="/Static/mobile/css/addressManage.css">
<script src="/Static/mobile/js/areadata.js"></script>
<script src="/Static/mobile/js/myarea.js"></script>
<script src="/Static/mobile/js/expressdata.js?5555"></script>
<style>

    .youhui{
        position: absolute;
        right: 6px;
        width:100px;
        height:22px;
        display:block;
    }
    .pad50{
        padding-bottom: 200px
    }
</style>
<style>

    .mgt40{
        margin-top:40px;
    }
    .mcart_pay{
        bottom:51px;
        positon:absolute;
    }
    .heji {
        max-width: 140px;
        overflow: hidden;
        position: absolute;
        right: 160px;
        bottom: 0px;
    }
    .mcart_pay .mcart_pay_ri {
        position: absolute;
        height:100%;
        width:100%;
    }

    .mcart_pay .mcart_pay_ri a {
        float: left;
        display: inline-block;
        padding: 0 16px;
        background: #ff5000;
        font-size: 16px;
        color: #fff;
        margin-left: 6px;
        position: absolute;
        bottom: 0px;
        right: 0px;
    }
    <?php if(!$is_mobile){ ?>

                             .mcart_tit{
                                 position:absolute;
                             }
    .mcart_pay {
        height: 50px;
        line-height: 50px;
        overflow: hidden;
        border: #ededed solid 1px;
        border-width: 1px 0;
        background: #fff;
        position: fixed;
        bottom: 0px;
        left: 0;
        width: 100%;
        z-index: 1;
        width:25%;
        margin:0 auto;
        right:0;
        left:0;
    }
    .nav{
        position:fixed;
        width:25%;

    }

    <?php } ?>

</style>


<div class="membersbox pad50">
    <section class="mcart_tit"><span>订单页面<i class="j-totalNum" style="display:none;">1</i></span>
        <!--<b class="del-item" id="delall">清空</b>-->
    </section>
    <div>
        <i id="Partner"><?php echo C('Partner');?></i>
        <i id="City_Partner"></i>
        <i id="Official_Partner"><?php echo C('Official_Partner');?></i>
    </div>
    <form action="/mobile/orderadd" method="post" id="form" class="mgt40">
        <section class="fixinline pdl10">
            <span style="color:red;">*</span>请选择合伙人身份:
            <select id="identity">
                <option>---请选择合伙人身份-----</option>
                <option value="1">合伙人</option>
                <option value="2">城市合伙人</option>
                <option value="3">公司合伙人</option>
            </select>
        </section>
        <!--
            <section class="textarea_content clearfix">
                <section class="content-name fl"></section>
                <section class="content-textarea fl">
                    <select id="province" name="province" style="width:200px;"></select>
                </section>
            </section>
        </div>
        -->
        <section class="mcart_goods">
            <ul>
                <?php foreach($goods_info as $key=>$goods){ ?>
                <li class="g-box">
                    <section class="mcart_goods_img">
                        <a href="javascript:void(0);">
                            <img src="<?php echo C('UPYUN_DOMAIN').$goods['goods_pic'];?>!headimgurl" width="80" height="80"  onerror="javascript:this.src='/Static/mobile/images/goods.jpg';">
                        </a><b></b>
                        <label class="btn-check J-inp">
                            <em class="cur"></em>
                        </label>
                        <input type="checkbox" name="checkbox[]" value="<?php echo $goods['goods_id'];?>"  >
                    </section>
                    <section class="mcart_goods_infor g-flex clearfix">
                        <section class="mcart_goods_title">
                            <a href="javascript:void(0);"><?php echo $goods['goods_name'];?></a>
                            <p style="color:#333;"><?php echo $goods['guige_name_new'];?></p>

                            <?php if($goods['double_buy']>1){?>
                            <em class="beishu"><?php echo $goods['double_buy']; echo $goods['unit'] ? $goods['unit'] : '件';?>起订</em>
                            <?php } ?>

                        </section>
                        <section class="num">

                            <?php if($goods['gtype_id']==9) { ?>

                            <i>

                                <span class="integer">0</span>
                                <span class="decimal font12">00</span>
                                <span style="font-size:10px">积分</span>
                                <span class="nums" style="display: none;"><?php echo $goods['shop_price'];?></span>
                            </i>
                            <?php }else{ ?>
                            <i>
                                <span style="font-size:10px">￥</span>
                                <span class="integer">0</span>
                                <span class="decimal font12">00</span>
                                <span class="nums" style="display: none;"><?php echo $goods['shop_price'];?></span>
                            </i>
                            <del><span style="font-size:10px">￥</span><?php echo $goods['market_price'];?></del>

                            <?php } ?>

                            <span>
                                <input type="tel" data-id="<?php echo $goods['goods_id'];?>" class="j-rcNum appearance"  readonly   max_buy="<?php echo $goods['max_buy'] ? $goods['max_buy'] : 0;?>" min_buy="<?php echo $goods['min_buy'] ? $goods['min_buy'] : 1;?>" double_buy="<?php echo $goods['double_buy'] ? $goods['double_buy'] : 1;?>" value="<?php echo $goods['min_buy'] ? $goods['min_buy'] : ($goods['num']?$goods['num']:1);?>">
                                <input type="hidden" class="j-rcPrice" value="<?php echo $goods['shop_price'];?>">
                                <input type="hidden" class="j-rcDiscount" value="<?php echo 1;?>">
                                <input type="hidden" class="goods_weight" value="<?php echo $goods['goods_weight'];?>">
                                <input type="hidden" class="is_brand" value="<?php echo $goods['is_brand'];?>">
                                <input type="hidden" name="num">
                                <input type="hidden" class="j-rcScore" value="<?php echo $goods['score_rate'];?>">
                                <input type="hidden" name="sku_id[]" value="0">
                                <input type="hidden" name="guige_id[]" value="<?php echo $goods['guige_id'];?>">
                                 <input type="hidden" name="guige_id_new[]" value="<?php echo $goods['guige_id_new'];?>">
                                <input type="hidden" name="guige_name_new[]" value="<?php echo $goods['guige_name_new'];?>">
                                <input type="hidden" class="j-rcShiwu" value="<?php echo $goods['is_shiwu'];?>">
                                <input type="hidden" class="grade1_price" value="<?php echo $goods['grade1_price'];?>">
                                <input type="hidden" class="grade2_price" value="<?php echo $goods['grade2_price'];?>">
                                <input type="hidden" class="grade3_price" value="<?php echo $goods['grade3_price'];?>">
                                <input type="hidden" class="grade4_price" value="<?php echo $goods['grade4_price'];?>">
                                <input type="hidden" class="grade5_price" value="<?php echo $goods['grade5_price'];?>">
                                <input type="hidden" class="grade6_price" value="<?php echo $goods['grade6_price'];?>">
                            </span>
                        </section>
                    </section>
                </li>
                <?php } ?>

            </ul>
        </section>
        <div class="msettlement_goods_con">
            <input type="hidden" name="pay_password" id="pay_password">
            <section class="fixinline pdl10">
                <section class="textarea_content clearfix">
                    <section class="content-name fl"><span style="color:red;">*</span><span id="shouhuoren"><?php echo $is_idcard ? "姓名" : "收货人"; ?></span>:</section>
                    <section class="content-input fl">
                        <input class="text" maxlength="5" value="<?=$delivery['delivery_name']?>" name="delivery_name" id="delivery_name" placeholder="必填，收货人真实姓名">
                    </section>
                </section>
            </section>
            <section class="fixinline pdl10">
                <section class="textarea_content clearfix">
                    <section class="content-name fl"><span style="color:red;">*</span>手机号:</section>
                    <section class="content-input fl">
                        <input type="tel" class="text" maxlength="11" value="<?=$delivery['delivery_mobile']?>" name="delivery_mobile"  id="delivery_mobile" placeholder="必填，收货人电话号码">
                    </section>
                </section>
            </section>
            <?php if($is_shiwu){ ?>
            <input type="hidden" value="<?php echo $delivery['province_id'];?>" name="province_id" id="province_id">
            <input type="hidden" value="<?php echo $delivery['city_id'];?>" name="city_id" id="city_id">
            <input type="hidden" value="<?php echo $delivery['county_id'];?>" name="county_id" id="county_id">
            <section class="fixinline pdl10">
                <section class="textarea_content clearfix">
                    <section class="content-name fl"><span style="color:red;">*</span>省份:</section>
                    <section class="content-textarea fl">
                        <select id="province" name="province" style="width:200px;"></select>
                    </section>
                </section>
            </section>

            <section class="fixinline pdl10">
                <section class="textarea_content clearfix">
                    <section class="content-name fl"><span style="color:red;">*</span>城市:</section>
                    <section class="content-textarea fl">
                        <select id="city" name="city" style="width:200px;"></select>
                    </section>
                </section>
            </section>

            <section class="fixinline pdl10">
                <section class="textarea_content clearfix">
                    <section class="content-name fl"><span style="color:red;">*</span>区域:</section>
                    <section class="content-textarea fl">
                        <select id="county" name="county" style="width:200px;"></select>
                    </section>
                </section>
            </section>


            <section class="fixinline pdl10">
                <section class="textarea_content clearfix">
                    <section class="content-name fl"><span style="color:red;">*</span>详细地址:</section>
                    <section class="content-input fl">
                        <input class="text" maxlength="60" value="<?php echo $delivery['address'];?>"  name="address" id="address" placeholder="必填，详细地址">
                    </section>
                </section>
            </section>
            <?php } ?>

            <section class="fixinline pdl10">
                <section class="textarea_content clearfix">
                    <section class="content-name fl"><?php if($is_shiwu == 0){?><span style="color:red;"></span><?php } ?>微信号:</section>
                    <section class="content-input fl">
                        <input class="text" maxlength="20" value="<?php echo $delivery['wechat_user'];?>"  name="wechat_user" id="wechat_user" placeholder="<?php echo ($is_shiwu == 0)?'选填':'选填'; ?>，您的微信号码">
                    </section>
                </section>
            </section>

            <section class="fixinline pdl10" style="display:none;">
                <section class="textarea_content clearfix">
                    <section class="content-name fl">发票抬头:</section>
                    <section class="content-textarea fl">
                        <textarea class="text" name="bill_name" placeholder="如需发票,请填写您的发票抬头"></textarea>
                    </section>
                </section>
            </section>

            <section class="fixinline pdl10">
                <section class="textarea_content clearfix">
                    <section class="content-name fl">买家留言:</section>
                    <section class="content-textarea fl">
                        <textarea class="text" name="khnote" placeholder="选填，可填写您和卖家达成一致的要求"></textarea>
                    </section>
                </section>
            </section>
        </div>
        <div class="msettlement_goods_con">
            <section class="post_fee pdl10">
                <section class="msettlement_tit">
                    <span>运费:</span>
                    <em class="fr">
                        <span id="yunfei_txt" style="color:#fe6e27;font-size:16px;width:100px;margin-right:15px;"></span>
                    </em>
                </section>
            </section>

            <section class="post_fee pdl10" style="display:none">
                <section class="msettlement_tit ">
                    <span style="">当前折扣比例:&nbsp;&nbsp;</span><span style="color:blue;font-weight:bold;font-size:15px" class="jianzhu_zhekou_txt">无</span>
                    <em class="settlement-choice fr"><i class="smallsize"></i>
                        <label class="btn-check youhui">
                        </label>
                    </em>
                </section>
            </section>
            <?php if($memberinfo['grade_id']>1){ ?>
            <section class="post_fee pdl10" id="zhekou_show" style="display:none;">
                <section class="msettlement_tit">
                    <span>会员折扣优惠:</span>
                    <em class=" fr" ><span id="zhekou_txt" style="color:#fe6e27;font-size:16px;width:100px;margin-right:15px;">¥0.00</span></em>
                </section>
            </section>
            <?php } ?>
            <?php if($memberinfo['tihuo_money'] >0 && !$is_brand){?>
            <section class="post_fee pdl10">
                <section class="msettlement_tit">
                    <span style=""><?php echo C('TIHUO_NAME');?>余额：<?php echo $memberinfo['tihuo_money'];?>元&nbsp;&nbsp;</span><span style="color:blue;font-weight:bold;font-size:15px" class="tihuo_txt use_money"></span>
                    <em class="settlement-choice fr"><i class="smallsize"></i>
                        <label class="btn-check youhui">
                            <input value="1" type="hidden" id="use_tihuo" name="use_tihuo">
                            <em class="cur" id="tihuo_em"></em>
                        </label>
                    </em>
                </section>
            </section>
            <?php }else{ ?>
            <input value="0" type="hidden" id="use_tihuo" name="use_tihuo">
            <?php } ?>
            <?php if($memberinfo['score']>0 && !$no_score){?>
            <section class="post_fee pdl10">
                <section class="msettlement_tit ">
                    <span style=""><?=C('SCORE_NAME')?>余额：<?=$memberinfo['score']?><?=C('SCORE_NAME')?>&nbsp;&nbsp; </span><span style="color:blue;font-weight:bold;font-size:15px" class="score_txt use_money"></span>
                    <em class="settlement-choice fr"><i class="smallsize"></i>
                        <label class="btn-check youhui">
                            <input value="1" type="hidden" id="use_score" name="use_score">
                            <em class="cur" id="score_em"></em>
                        </label>
                    </em>
                </section>
            </section>
            <?php }else{ ?>
            <input value="0" type="hidden" id="use_score" name="use_score">
            <?php } ?>
            <!-- 奖励佣金 -->
            <?php if($memberinfo['prize_money']>0){?>
            <section class="post_fee pdl10">
                <section class="msettlement_tit">
                    <span style="">奖励佣金余额：<?=$memberinfo['prize_money']?>元&nbsp;&nbsp; </span><span style="color:blue;font-weight:bold;font-size:15px" class="prize_txt use_money"></span>
                    <em class="settlement-choice fr"><i class="smallsize"></i>
                        <label class="btn-check youhui">
                            <input value="1" type="hidden" id="use_prize" name="use_prize">
                            <em class="cur" id="prize_em"></em>
                        </label>

                    </em>

                </section>
            </section>
            <?php }else{ ?>
            <input value="0" type="hidden" id="use_prize" name="use_prize">
            <?php } ?>
            <?php if($memberinfo['money']>0){?>
            <section class="post_fee pdl10">
                <section class="msettlement_tit">
                    <span style=""><?=C('YONGJIN_NAME')?>余额：<?=$memberinfo['money']?>元&nbsp;&nbsp; </span><span style="color:blue;font-weight:bold;font-size:15px" class="yongjin_txt use_money"></span>
                    <em class="settlement-choice fr"><i class="smallsize"></i>
                        <label class="btn-check youhui">
                            <input value="1" type="hidden" id="use_yongjin" name="use_yongjin">
                            <em class="cur" id="yongjin_em"></em>
                        </label>

                    </em>

                </section>
            </section>
            <?php }else{ ?>

            <input value="0" type="hidden" id="use_yongjin" name="use_yongjin">

            <?php } ?>

            <?php if($memberinfo['cash_money']>0){?>
            <section class="post_fee pdl10">
                <section class="msettlement_tit">
                    <span style=""><?=C('CASH_NAME')?>余额：<?=$memberinfo['cash_money']?>元&nbsp;&nbsp; </span><span style="color:blue;font-weight:bold;font-size:15px" class="cash_money_txt use_money"></span>
                    <em class="settlement-choice fr"><i class="smallsize"></i>

                        <label class="btn-check youhui">
                            <input value="1" type="hidden" id="use_cash" name="use_cash">
                            <em class="cur" id="cash_em"></em>
                        </label>

                    </em>

                </section>
            </section>
            <?php }else{ ?>
            <input value="0" type="hidden" id="use_cash" name="use_cash">
            <?php } ?>
            <input value="<?php echo $memberinfo['tihuo_money'];?>" type="hidden" id="tihuo_money">
            <input value="<?php echo $memberinfo['cash_money'];?>" type="hidden" id="cash_money">
            <input value="<?php echo $memberinfo['score'];?>" type="hidden" id="score">
            <input value="<?php echo $memberinfo['money'];?>" type="hidden" id="money">
            <input value="<?php echo $memberinfo['prize_money'];?>" type="hidden" id="prize">
            <input value="<?php echo $memberinfo['ex_cash'];?>" type="hidden" id="ex_cash">
        </div>
        <input type="hidden" name="dis" id="j-rcDiscount" value="1">
        <section class="mcart_pay" >
            <label id="chooseAll" class="J-quanx"  style="z-index:9999;"><b  class="cur"></b>全选</label>
            <input type="checkbox" class="j-ip-selectAll" checked="">
            <section class="mcart_pay_ri">
			<span class="heji">
				<b>合计：<strong><em class="integer" style="font-size:14px;"></em>
				<em class="decimal font12">00</em>
				<i id="j-resultTotal" class="nums" style="display: none;">0.00</i></strong>
			</span>
                <a href="javascript:;" id="buyer"><span id="ccc">结算</span>(<i class="j-totalNum">1</i>)</a>
            </section>
        </section>
    </form>
    <b id="htmlReplace-navCart"></b>

</div>


<script>
    var full_baoyou = "<?php echo C('FULL_BAOYOU');?>";
    var notfull_baoyou = "<?php echo C('NOTFULL_BAOYOU');?>";
    var is_shiwu = "<?php echo $is_shiwu;?>";
    var is_ningjiao = "<?php echo get('goods_id')==16?1:0;?>";
    var is_ningjiao_lingshou = "<?php echo get('goods_id')==17?1:0;?>";
    var goods_id = "<?php echo get('goods_id');?>";
    full_baoyou = parseFloat(full_baoyou);
    is_shiwu = parseFloat(is_shiwu);

    var delivery_name = "<?=$delivery['delivery_name']?>";
    var delivery_mobile = "<?=$delivery['delivery_mobile']?>";
</script>

<script type="text/javascript">
    city.getcity('province','city','county','<?php echo $delivery['province'];?>','<?php echo $delivery['city'];?>','<?php echo $delivery['county'];?>',1);
    $(function () {
        $("#identity").change(function () {
            var identity=$(this).val();
            var money=0;
            if(identity==1){
                money="<?php echo C('Partner');?>";
            }else if(identity==2){
                money="<?php echo C('City_Partner');?>";
            }else if(identity==3){
                money="<?php echo C('Official_Partner');?>";
            }else {
                money="<?php echo C('Partner');?>";
            }
            var num=Math.ceil(money/255)
            $(".appearance").attr('value',num);

        });

        //减少购买数量
        $(".edd").click(function () {
            var b = $(this).parent().children(".j-rcNum").val();
            var now=b-1;//减少之后的数量
            var identity=parseInt($("#identity").val());
            var money=0;
            if(identity==1){
                money="<?php echo C('Partner');?>";
            }else if(identity==2){
                money="<?php echo C('City_Partner');?>";
            }else if(identity==3){
                money="<?php echo C('Official_Partner');?>";
            }else {
                money="<?php echo C('Partner');?>";
            }
            switch (identity){
                case (1):
                    var num=Math.ceil(money/255)
                    if(now<num && now!=num){
                        alert('成为合伙人不能小于:'+num);
                    }
                    return;
                    break;
                case (2):
                    var num=Math.ceil(money/255)
                    if(now<num && now!=num){
                        $("#identity").find("option[value=1]").attr("selected",true);
                    }
                    break;
                case (3):
                    var num=Math.ceil(money/255)
                    if(now<num && now!=num){
                        $("#identity").find("option[value=2]").attr("selected",true);
                    }
                    break;
                default:
                    alert('请选择属于自己合作身份');
                    break;
            }
        })
    });
    function jiesuan(){

        var delivery_mobile = $("#delivery_mobile").val();
        var delivery_name = $("#delivery_name").val();

        if(!delivery_name){
            showerror("请填写收货人姓名");
            return false;
        }

        if(!isMobile(delivery_mobile)){
            showerror("请检查手机号码是否填写正确");
            return false;
        }

    <?php if($is_shiwu){ ?>
            //实物
            var address = $("#address").val();
            var province = $("#province").val();
            var city = $("#city").val();
            var county = $("#county").val();

            var province_id = $("#province :selected").attr('aid');
            var city_id = $("#city :selected").attr('aid');
            var county_id = $("#county :selected").attr('aid');
            $('#province_id').val(province_id);
            $('#city_id').val(city_id);
            $('#county_id').val(county_id);


            if(!province){
                showerror("请选择省份");
                return false;
            }

            if(!city){
                showerror("请选择城市");
                return false;
            }

            if(!county){
                showerror("请选择区域");
                return false;
            }

            if(!address){
                showerror("请填写详细地址");
                return false;
            }
        <?php }else{ ?>
            //虚拟
            var wechat_user = $("#wechat_user").val();

            if(!wechat_user){
                //showerror("请填写微信号");
                //return false;
            }

        <?php } ?>




        AjaxFormSubmit();
    }

    function addorder () {
        var formId = "form";
        if ($('#' + formId).length == 0) {
            return false;
        }
        var action = $('#' + formId).attr('action');
        if (!action) {
            action = location.href;
        }

        $.ajax({
            url : action,
            type : 'post',
            data : $('#' + formId).serialize(),
            dataType : 'json',
            success : function(data) {
                layer.closeAll();
                if(data.url){
                    var urls = data.url;
                }else{
                    var urls = '';
                }

                if(data.ret == 0){
                    showsuccess(data.msg,urls);
                }else{
                    $('#pay_password').val('');
                    showerror(data.msg,urls);
                }
            },
            beforeSend:function(){
                layer.open({
                    type: 2,
                    shade: true,
                    shadeClose: false,
                });

            },
            error: function() {
                $('#pay_password').val('');
                layer.closeAll();//鍏抽棴鎵€鏈�
                showerror("缃戠粶閿欒,璇烽噸璇�");
            }

        });
    }

</script>
<script src="/Static/mobile/js/cart.js?v=1"></script>
<script>

</script>
<style>
    .nav section .nav-item.wid4{
        width:25%;
    }
    .nav-item h2 {
        line-height: 20px;
        top: -5px;
        position: relative;
    }
    body{
        line-height: inherit;
    }
</style>
<div class="nav">
    <section class="inner">
        <section class="nav-lists clearfix hasmenu9">
            <dl class="nav-item j-showNavSub wid4 style1 fl">
                <dt>
                    <a href="/mobile/" style="background-color: #fff; color: #333">
                        <i style="font-size: 20px;<?php echo $controller=='index'?'color:#3BA7D5;':'';?>" class="icon iconfont icon-home<?php echo $controller=='index'?'fill':'';?>"><h2>首页</h2></i>
                    </a>
                </dt>
            </dl>
            <dl class="nav-item j-showNavSub wid4 style1 fl">
                <dt>
                    <a href="/mobile/cart/daili" style="background-color: #fff; color: #333">
                        <i style="font-size: 20px;<?php echo $action=='baodan'?'color:#3BA7D5;':'';?>" class="icon iconfont icon-list<?php echo $action=='daili'?'':'';?>"><h2>申请代理</h2></i>
                    </a>
                </dt>
            </dl>
            
             <dl class="nav-item j-showNavSub wid4 style1 fl">
                <dt>
                    <a href="/mobile/cart/mycart" style="background-color: #fff; color: #333">
                        <i style="font-size: 20px;<?php echo $controller=='cart'&&$action=='mycart'?'color:#3BA7D5;':'';?>" class="icon iconfont icon-cart<?php echo $controller=='cart'&&$action=='mycart'?'_fill':'';?>_light"><h2>购物车</h2></i>
                    </a>
                </dt>
            </dl>
            <!--
           <dl class="nav-item j-showNavSub wid4 style1 fl">
                <dt>
                    <a href="/mobile/cart/buhuo" style="background-color: #fff; color: #333">
                        <i style="font-size: 20px;<?php echo $action=='buhuo'?'color:#3BA7D5;':'';?>" class="icon iconfont icon-list<?php echo $action=='buhuo'?'':'';?>"><h2>补货</h2></i>
                    </a>
                </dt>
            </dl>
            
            <dl class="nav-item j-showNavSub wid4 style1 fl">
                <dt>
                    <a href="/mobile/cart/transfer" style="background-color: #fff; color: #333">
                        <i style="font-size: 20px;<?php echo $action=='transfer'?'color:#3BA7D5;':'';?>" class="icon iconfont icon-list<?php echo $action=='transfer'?'':'';?>"><h2>拨货</h2></i>
                    </a>
                </dt>
            </dl> -->
            <dl class="nav-item j-showNavSub wid4 style1 fl">
                <dt>
                    <a href="/mobile/user" style="background-color: #fff; color: #333">
                        <i style="font-size: 20px;<?php echo $controller=='user'?'color:#3BA7D5;':'';?>" class="icon iconfont icon-people<?php echo $controller=='user'?'fill':'';?>"><h2>我的</h2></i>

                    </a>
                </dt>
            </dl>
        </section>
    </section>
</div>

<!-- 如果是微信客户端 -->
<input id="networkType" value="" type="hidden">
<?php if($is_wechat){ ?>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js" type="text/javascript"></script>
<script type="text/javascript">
		wx.config({
		
		<?php if($hlopenid =="oaGjOtyJCTObWB2BZbkLfxyVHTMA"){?>
		 debug:true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，
		
		<?php } ?>
		
		  //若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
		  appId:'<?php echo ($jssign['appid']); ?>', // 必填，公众号的唯一标识
		  timestamp:'<?php echo ($jssign['timestamp']); ?>', // 必填，生成签名的时间戳
		  nonceStr:'<?php echo ($jssign['noncestr']); ?>', // 必填，生成签名的随机串
		  signature:'<?php echo ($jssign['signature']); ?>',// 必填，签名，见附录1
	      jsApiList: [
	                  'checkJsApi',
	                  'onMenuShareTimeline',
	                  'onMenuShareAppMessage',
	                  'onMenuShareQQ',
	                  'onMenuShareWeibo',
	                  'onMenuShareQZone',
	                  'hideMenuItems',
	                  'showMenuItems',
	                  'hideAllNonBaseMenuItem',
	                  'showAllNonBaseMenuItem',
	                  'translateVoice',
	                  'startRecord',
	                  'stopRecord',
	                  'onVoiceRecordEnd',
	                  'playVoice',
	                  'onVoicePlayEnd',
	                  'pauseVoice',
	                  'stopVoice',
	                  'uploadVoice',
	                  'downloadVoice',
	                  'chooseImage',
	                  'previewImage',
	                  'uploadImage',
	                  'downloadImage',
	                  'getNetworkType',
	                  'openLocation',
	                  'getLocation',
	                  'hideOptionMenu',
	                  'showOptionMenu',
	                  'closeWindow',
	                  'scanQRCode',
	                  'chooseWXPay',
	                  'openProductSpecificView',
	                  'addCard',
	                  'chooseCard',
	                  'openCard'
	                ] // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
		});
		
		wx.ready(function(){
			//分享到朋友圈
		  wx.onMenuShareTimeline({
		    title:'<?php echo $share_title ? $share_title : C("SHARE_DEFAULT_TITLE");?>', // 分享标题
		    link:'<?php echo $share_url ? $share_url : C("SHARE_DEFAULT_URL");?>', // 分享链接
		    imgUrl:'<?php echo $share_img ? $share_img : C("SHARE_DEFAULT_IMG");?>', // 分享图标
		    success: function(){
		    	
		    },
		    cancel: function(){
		    }
		  });
		  //分享给好友
		  wx.onMenuShareAppMessage({
		    title:'<?php echo $share_title ? $share_title : C("SHARE_DEFAULT_TITLE");?>', // 分享标题
		    desc:'<?php echo $share_description ? $share_description : C("SHARE_DEFAULT_DESC");?>', // 分享描述
		    link:'<?php echo $share_url ? $share_url : C("SHARE_DEFAULT_URL");?>', // 分享链接
		    imgUrl:'<?php echo $share_img ? $share_img : C("SHARE_DEFAULT_IMG");?>', // 分享图标
		    type: '',
		    dataUrl: '',
		    success: function () { 
		    },
		    cancel: function () { 
		
		    }
		  });  
		  
		  wx.getNetworkType({
			    success: function (res) {
			        var networkType = res.networkType; // 返回网络类型2g，3g，4g，wifi
			        $("#networkType").val(networkType);
			    }
			});
		  
		  //复制链接menuItem:copyUrl
		  wx.hideMenuItems({
			 menuList: ["menuItem:originPage",
			            "menuItem:share:facebook",
			            "menuItem:share:qq",
			            "menuItem:share:weiboApp",
			            "menuItem:share:QZone",
			            "menuItem:readMode",
			         //   "menuItem:openWithQQBrowser",
			         //   "menuItem:openWithSafari",
			            "menuItem:share:email",
			            "menuItem:share:brand",
			            "menuItem:copyUrl",//复制链接
			            <?php if($controller == 'qrcode'){ ?>
			            "menuItem:share:timeline",//朋友圈
			            "menuItem:share:appMessage",//朋友
			            <?php } ?>
			            ], // 要隐藏的菜单项，只能隐藏“传播类”和“保护类”按钮，所有menu项见附录3
		      success: function (res) {
		         // alert('已隐藏“阅读模式”，“分享到朋友圈”，“复制链接”等按钮');
		        },
		        fail: function (res) {
		          //alert(JSON.stringify(res));
		        }
		  });
		  
		  //wx.hideOptionMenu();//批量隐藏保护类 传播类按钮
		 
		});

		//浏览图片
		function previewImage(now_pic,pics){
			wx.previewImage({
			   current: now_pic, // 当前显示图片的http链接
			   urls: pics // 需要预览的图片http链接列表
			});
		}
		
		//浏览图片
		$('.previewImageList').on('click', function(){
			var now_pic = $(this).attr("src");
			var pics = new Array();
			
			$('.previewImage').each(function(index) {
				pics[index] = $(this).attr("src");
			 });
			
			previewImage(now_pic,pics);
			
		});

		</script>

<?php } ?>
<script>
//image lazyload
$(function(){
    $("img.lazyload").lazyload({
        threshold:650
    });
});
<?php if($showad) { ?>
var html = '<div><?php echo htmlspecialchars_decode(C('AD_DETAIL'));?></div>';
var pageii = layer.open({
  type: 1
  ,content: html
  ,anim: 'up'
  ,style: 'position:fixed;overflow:scroll; left:10%; top:15%; width:80%; max-height:70%; border: none; -webkit-animation-duration: .5s; animation-duration: .5s;'
});      
var adHeight = $('#showad').height();
$('.layui-m-layercont').css('height',adHeight+'px');
$('.layermanim').css('height',adHeight+'px');
<?php } ?>

</script>
</body>
</html>